﻿@model Cat_LandModel
@{
    ViewBag.Title = "kimThanhHouse";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

@section HeaderContent{

    <script type="text/javascript">

        $(document).ready(function () {
            var page = $("#countPage").val();
            var url = "/CatLand/GetCatLand";
            loadMore(url, page, 100);
        });


        function openNew() {
            var dt = new Date();
            var href = "/CatLand/openEdit?id=&dt=" + dt.getTime();
            $("#popup_content").load(href);
            showPopup('Insert product...');
        }


        function openEdit() {
            var lstSelected = "";
            $("div.row_01 div.checked").each(function () {
                //$(this).attr('name');
                lstSelected = lstSelected + ";" + $(this).attr("id");
            });

            var lsCount = lstSelected.length;

            if (lsCount > 37) {
                cusAlert("Bạn chỉ cập nhật thông tin một dữ liệu...");
            }
            else if (lsCount <= 0) {
                cusAlert("Vui lòng chọn dữ liệu để cập nhật");
            }
            else {
                var _DisCode = lstSelected.split(";");
                itemcode = _DisCode[1];

                var dt = new Date();
                var href = "/CatLand/openEdit?id=" + itemcode + "&dt=" + dt.getTime();
                $("#popup_content").load(href);
                showPopup('Insert product...');
            }

        }

    </script>

}

@section Toolbar {
<a class="btn_boder btn_new" onclick="openNew()">New</a>

<a class="btn_boder btn_edit" onclick="openEdit()" >Edit</a>
<a class="btn_boder btn_delete">Delete</a>

}

@Html.Hidden("countPage", 1)

<div id="divlist" class="divlist">
    <div class="gird-title">
        <div class="gird-itemTitle row_01">Chọn</div>
        <div class="gird-itemTitle row_02">@Cat_LandModel.FieldName.Code.Translate()</div>
        <div class="gird-itemTitle row_03">@Cat_LandModel.FieldName.LandCategoryName.Translate()</div>
        <div class="gird-itemTitle row_04">@Cat_LandModel.FieldName.CategoryType.Translate()</div>              
        <div class="gird-itemTitle rowEnd">@Cat_LandModel.FieldName.Notes.Translate()</div>
    </div>
    
     @Html.Partial("UC_CatLand_List")     

</div>



